package com.qfedu.vhr.controller.employee;

import com.qfedu.vhr.common.RespBean;
import com.qfedu.vhr.controller.R;
import com.qfedu.vhr.employee.entity.Employee;
import com.qfedu.vhr.employee.service.IEmployeeService;
import com.qfedu.vhr.employee.service.impl.EmployeeServiceImpl;
import com.qfedu.vhr.system.EntityMappo.RtBranchDeviceDataVo;
import com.qfedu.vhr.system.EntityMappo.RtBranchServiceHandleDataVo;
import com.qfedu.vhr.system.service.impl.RtDeviceStatisticsDataServic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author baize
 * @date 2023/2/8
 * @site www.qfedu.com
 */
@RestController
@RequestMapping("/employee/basic/emp")
public class EmployeeController {

    @Autowired
   private RtDeviceStatisticsDataServic rtDeviceStatisticsDataServic;

    @Autowired
    IEmployeeService employeeService;





    @GetMapping("/rtDeviceStatistics")
    public R<List<RtBranchDeviceDataVo>> rtDeviceStatistics(){
        List<RtBranchDeviceDataVo> list =  rtDeviceStatisticsDataServic.selectDavitistics();
        return R.ok(list);
    }

    @GetMapping("/rtServiceStatistics")
    public R<List<RtBranchServiceHandleDataVo>> rtServiceStatistics(){
        List<RtBranchServiceHandleDataVo> deCoverVos = rtDeviceStatisticsDataServic.rtServiceStatistics();
        return R.ok(deCoverVos);
    }


    /**
     * 查询员工基本信息
     * @return
     */
    @GetMapping("/")
    public List<Employee> getAll() {
        return employeeService.list();
    }

    /**
     * 修改员工基本信息
     */
    @PutMapping("/")
    public RespBean modify(@RequestBody Employee employee){
        return employeeService.modify(employee);
    }
}
